import { Allow, IsEnum, IsNotEmpty } from 'class-validator'
import i18n from '@/i18n'
import { ApiProperty } from '@nestjs/swagger'
import { MetaRealtimeDataWsPushAction } from '../../websocket/meta-realtime-data-ws/entity/meta-realtime-data-ws-action'

export class MetaOpenApiPushWsDataDto {
  @ApiProperty({ description: i18n.t('app-meta.dto.meta-open-api-push-ws-data.12151138-0') })
  @IsNotEmpty()
  uniqueId: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-open-api-push-ws-data.12151138-1') })
  @IsNotEmpty()
  @IsEnum(MetaRealtimeDataWsPushAction)
  action: MetaRealtimeDataWsPushAction

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-open-api-push-ws-data.12151138-2') })
  @Allow()
  data?: any
}
